import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

var routes = [
  {
    path: '/',
    redirect: '/update',
  },
  {
    path: '/home',
    name: 'home',
    redirect: '/index',
    component: () => import(/* webpackChunkName: "mobile" */ '../views/Home.vue'),
    children: [
      {
        path: '/index',
        name: 'index',
        meta: { keepAlive: true }, //true缓存 false不缓存
        component: () => import(/* webpackChunkName: "mobile" */ '../views/mobile/index.vue')
      },
      {
        path: '/geren',
        name: 'geren',
        meta: { keepAlive: true },
        component: () => import(/* webpackChunkName: "mobile" */ '../views/mobile/geren.vue')
      },
      {
        path: '/userIndex',
        name: 'userIndex',
        component: () => import(/* webpackChunkName: "user" */ '../views/user/userIndex.vue')
      },
      // 用户基本信息
      {
        path: '/userInfo',
        name: 'userInfo',
        component: () => import(/* webpackChunkName: "user" */ '../views/user/userInfo.vue')
      },
      // 福利中心
      {
        path: '/scoreList',
        name: 'scoreList',
        component: () => import(/* webpackChunkName: "user" */ '../views/user/scoreList.vue')
      },
      // 积分记录
      {
        path: '/scoreHistory',
        name: 'scoreHistory',
        component: () => import(/* webpackChunkName: "user" */ '../views/user/scoreHistory.vue')
      },
      //健康档案
      {
        path: '/healthRecords',
        name: 'healthRecords',
        component: () => import(/* webpackChunkName: "user" */ '../views/user/healthRecords.vue')
      },
      //上传健康档案
      {
        path: '/uploadRecords',
        name: 'uploadRecords',
        component: () => import(/* webpackChunkName: "user" */ '../views/user/uploadRecords.vue')
      },
      //公告列表
      {
        path: '/noticeList',
        name: 'noticeList',
        component: () => import(/* webpackChunkName: "user" */ '../views/user/noticeList.vue')
      },
      // 文章详情
      {
        path: '/topicDetail',
        name: 'topicDetail',
        component: () => import(/* webpackChunkName: "content" */ '../views/content/topicDetail.vue')
      },
      {
        path: '/contentList',
        name: 'contentList',
        component: () => import(/* webpackChunkName: "content" */ '../views/content/contentList.vue')
      },
      // 医生列表
      {
        path: '/doctorList',
        name: 'doctorList',
        component: () => import(/* webpackChunkName: "doctor" */ '../views/doctor/doctorList.vue')
      },
      // 医生详情
      {
        path: '/doctorDetail',
        name: 'doctorDetail',
        component: () => import(/* webpackChunkName: "doctor" */ '../views/doctor/doctorDetail.vue')
      },
      // 医生申请列表
      {
        path: '/doctorApplyList',
        name: 'doctorApplyList',
        component: () => import(/* webpackChunkName: "doctor" */ '../views/doctor/doctorApplyList.vue')
      },
      // 家庭服务套餐
      {
        path: '/familyIndex',
        name: 'familyIndex',
        // meta: { keepAlive: true },
        component: () => import(/* webpackChunkName: "family" */ '../views/familyDoctor/familyIndex.vue')
      },
      // 加号 亲情就诊 记录
      {
        path: '/historyList',
        name: 'historyList',
        component: () => import(/* webpackChunkName: "family" */ '../views/familyDoctor/historyList.vue')
      },
      //我的家庭
      {
        path: '/myFamily',
        name: 'myFamily',
        component: () => import(/* webpackChunkName: "family" */ '../views/familyDoctor/myFamily.vue')
      },
      // 助理端首页
      {
        path: '/aideIndex',
        name: 'aideIndex',
        meta: { keepAlive: true },
        component: () => import(/* webpackChunkName: "aide" */ '../views/aide/aideIndex.vue'),
      },
      // 我的患者
      {
        path: '/myPatient',
        name: 'myPatient',
        component: () => import(/* webpackChunkName: "aide" */ '../views/aide/myPatient.vue')
      },
      // 患者详情
      {
        path: '/patientDetail',
        name: 'patientDetail',
        component: () => import(/* webpackChunkName: "aide" */ '../views/aide/patientDetail.vue')
      },
      // 申请列表
      {
        path: '/applyList',
        name: 'applyList',
        component: () => import(/* webpackChunkName: "aide" */ '../views/aide/applyList.vue')
      },
      // 申请历史记录
      {
        path: '/applyHistory',
        name: 'applyHistory',
        component: () => import(/* webpackChunkName: "aide" */ '../views/aide/applyHistory.vue')
      },
      // 我的消息
      {
        path: '/message',
        name: 'message',
        component: () => import(/* webpackChunkName: "user" */ '../views/user/message.vue')
      },
      // 
      {
        path: '/sendPage',
        name: 'sendPage',
        component: () => import(/* webpackChunkName: "user" */ '../views/user/sendPage.vue')
      },
      // 我的申请列表
      {
        path: '/myApplyList',
        name: 'myApplyList',
        component: () => import(/* webpackChunkName: "user" */ '../views/user/myApplyList.vue')
      },
      // 我的审核列表
      {
        path: '/applyPage',
        name: 'applyPage',
        component: () => import(/* webpackChunkName: "user" */ '../views/user/applyPage.vue')
      },
      // 我的购买记录
      {
        path: '/buyHistory',
        name: 'buyHistory',
        component: () => import(/* webpackChunkName: "user" */ '../views/user/buyHistory.vue')
      },
      // 关于
      {
        path: '/about',
        name: 'about',
        component: () => import(/* webpackChunkName: "user" */ '../views/about/about.vue')
      },
      {
        path: '/gnjs',
        name: 'gnjs',
        component: () => import(/* webpackChunkName: "user" */ '../views/about/gnjs.vue')
      },
      {
        path: '/yszc',
        name: 'yszc',
        component: () => import(/* webpackChunkName: "user" */ '../views/about/yszc.vue')
      },
      {
        path: '/yhxy',
        name: 'yhxy',
        component: () => import(/* webpackChunkName: "user" */ '../views/about/yhxy.vue')
      },
      {
        path: '/tbsm',
        name: 'tbsm',
        component: () => import(/* webpackChunkName: "user" */ '../views/about/tbsm.vue')
      },
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "mobile" */ '../views/mobile/login.vue')
  },
  {
    path: '/wxLogin',
    name: 'wxLogin',
    component: () => import(/* webpackChunkName: "mobile" */ '../views/mobile/wxLogin.vue')
  },
  // 更新页
  {
    path: '/update',
    name: 'update',
    component: () => import(/* webpackChunkName: "mobile" */ '../views/mobile/update.vue')
  },
  // 进入页
  {
    path: '/enterPage',
    name: 'enterPage',
    component: () => import(/* webpackChunkName: "mobile" */ '../views/mobile/enterPage.vue')
  },



]



const router = new VueRouter({
  routes,
})

router.beforeEach((to, from, next) => {

  return next()

})




export default router
